#!/bin/sh

#set -e

orgdir=`pwd`

echo "release no:"
read rel

echo "progname: (smartcard20):"
read progname
if [ "x${progname}" = "x" ] ; then
	progname=smartcard20
fi


OUTPATH=../../releases/
PROGPATH=${OUTPATH}/${progname}-${rel}


svn export . ${PROGPATH}

zipname="${progname}-${rel}.zip"
cd ${OUTPATH}
zip -r ${zipname} ${progname}-${rel}


md5sum ${zipname}          > ${zipname}.md5
sha1sum ${zipname}         > ${zipname}.sha1
gpg -o ${zipname}.gpg -sab   ${zipname} 

cd $orgdir
ls -la ${PROGPATH} ${OUTPATH}/${zipname} ${OUTPATH}/${zipname}.md5 ${OUTPATH}/${zipname}.sha1 ${OUTPATH}/${zipname}.gpg
